Workbench Help

Topics

What is Workbench?

Release Notes

Creating a Game

The Project Settings Window

TADS 3 Documentation

TADS 3 Articles

Modifying Workbench

Creating a Game

Creating a new game in Workbench is fairly easy. Simply launch Workbench (e.g. by double-clicking its item in the Finder). You should immediately get a new, untitled project window. If you don't get one, simply choose New Project from the File menu and you should get one.

Project files are divided into four groups:

  • Source Files holds all your source code for the game, i.e. the program you write. These files' names usually have the suffix ".t". Below that is the list of Include Folders, which means the folders where the TADS compiler will look for additional source files that you #include from your code.
  • Then come the Libraries, which should include "system.tl" and "adv3/adv3.tl". Libraries are pre-fabricated collections of code that provide functionality without you having to write them. E.g. adv3 provides all the adventure-specific stuff, like rooms, actors etc.

If you haven't done so already, save the project file (I'll use the name "sample.t3m"). You'll want to put it into a folder of its own, so you can later put all the source files for the game next to it. Then, let's create a new source file: Choose New Source File from the File menu. Save the file with the name you want your game to have (I'll use "sample.t" for now).

Now you have to add your file to the current project: Choose Add Current File from the Project menu. The file will be added to the Source Files group in your project. You can also use the Add Source File... menu item instead and select an existing file if you don't have one open.

Return to the text file and enter some TADS source code. I'll use:

#include "adv3.h"
#include "tok.h"
#include "en_us.h"

me: Person
    location = livingRoom
;


livingRoom: Room
    name = 'Living Room'
    destName = 'the living room'
    desc = "It's a nice, big room.  A potted plant is the only attempt
            at decoration.  Passages lead north, east, and west.
            To the south, the front door of the house
            leads outside. "
;

main(args)
{
    gPlayerChar = me;
    statusLine.showStatusLine();

    "Sample Game";
    "Welcome to the Game!\b";

    runGame(true);
}


mainRestore(args, restoreFile)
{
    local succ;

    "Sample Game";
    "Restoring saved game...\n";

    succ = RestoreAction.startupRestore(restoreFile);
    "\b";

    if (succ)
        runGame(nil);
}

Now, choose Build from the Project menu. After a little while, the compiler will be finished and you will have a new game (in my case, sample.t3). To run it, simply choose Build and Run instead of Build.